import scrapy


class SumSpider(scrapy.Spider):
    name = 'sum'
    # allowed_domains = ['sum.com']
    start_urls = ['http://wzzdg.sun0769.com/political/index/politicsNewest']

    def parse(self, response):
        print(response)
        print('在采集的数据')
    # 翻页操作
        next = response.xpath('//a[@class="arrow-page prov_rota"]/@href').extract_first()
        print(next)
        if next:
            yield scrapy.Request(url='http://wzzdg.sun0769.com' + next,callback=self.parse)

